<template>
  <div class="item">
    <div class="item_text" v-if="slogan!=''">
      <p class="ietm_slog">{{slogan}}</p>
      <p class="item_intro">{{introduction}}</p>
    </div>
    <h1 class="item_title">{{stitle}}<span style="font-weight: 200">{{img[0].title}}</span></h1>
      <div class="Dimg_list">
             <div v-for="i in img" v-bind:key ="i.title">
                <img class="Dimg"  :src="i.src" v-bind:style="{height: i.row?'auto':i.mheight>0?i.mheight + 'px':RSize.Rheight,width: i.row?'100%':RSize.Rwidth }">
                <br v-if="i.br">
            </div>
      </div>
      
      <!-- <div class="introduction_img" v-bind:style="{position:'relative',backgroundImage:`url(${img})`, backgroundRepeat:'no-repeat', backgroundPosition:'center center', backgroundSize: 'cover', height: height*0.5 + 'px' }">
      <div class="mask"></div> -->
    </div>
</template>

<script>
export default {
  name: "Ditem",
  props: {
    height: Number,
    width: Number,
    stitle: String,
    slogan: String,
    introduction: String,
    routerName: String,
    img: Array
  },
  data() {
    return {
      fullHeight: document.documentElement.clientHeight,
      fullWidth: document.documentElement.clientWidth
    };
  },
  computed: {
    // 计算属性的 getter
    RSize: function() {
      return {
          Rheight: this.width > 767 ? this.img[0].height + 'px' : "auto",
          Rwidth: this.width > 767 ?  'auto' : "100%"
      }
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.item {
  display: flex;
  width: 65%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 10px;
}
.item_text {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.item_title {
  font-size: 12px;
  font-weight: bold;
}
.ietm_slog {
  margin-bottom: 0px;
  font-size: 32px;
  font-weight: bold;
  text-align: left;
}
.item_intro {
  font-size: 12px;
  font-weight: 200;
  text-align: left;
}
a {
  color: #000000;
  font-size: 12px;
  text-decoration: none;
}
.introduction_img {
  width: 45%;
  display: flex;
  flex-direction: column;
  align-items: left;
  justify-content: center;
}

.introduction_img:hover {
  box-shadow: 10px 10px 10px #dfdfdf, -5px -5px 20px #dfdfdf,
    -5px -5px 20px #dfdfdf, 20px 20px 20px #dfdfdf;
}

.Dimg {
  margin: 15px;
}

.Dimg:hover {
  box-shadow: 10px 10px 10px #dfdfdf, -5px -5px 20px #dfdfdf,
    -5px -5px 20px #dfdfdf, 20px 20px 20px #dfdfdf;
}
.img-nav_img {
  width: inherit;
  display: flex;
  /* border: 1px solid #eeeeee; */
}
.img-nav_des_p {
  display: flex;
  justify-content: left;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
}
.mask {
  position: absolute;
  background: none;
  width: 100%;
  height: inherit;
}

.Dimg_list {
  display: flex;
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
}

@media screen and (min-width: 767px) and (max-width: 1080px) {
  .ietm_slog {
    font-size: 28px;
    font-weight: bold;
  }
}
@media only screen and (max-width: 767px) {
  .item {
    display: flex;
    width: 80%;
    flex-direction: column;
    justify-content: space-around;
    border-top: 1px solid #eeeeee;
  }
  .item_text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .introduction_img {
    margin-top: 50px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .Dimg {
    width: 100%;
    height: auto;
  }
}
</style>
